<!-- Thêm acceptCharset="ISO-8859-1" vào form -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<html:base />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Create New Post</title>
<link type="text/css" rel="stylesheet"
	href="../../../ckeditor/_samples/sample.css" />
<link type="text/css" rel="stylesheet" href="../../style.css" />
</head>
<body>
	<h1>Create New Post</h1>
	<html:form action="createPost.do" method="post" acceptCharset="UTF-8" enctype="multipart/form-data">
		<table>
			<tr>
				<td><label for="title" /><bean:message key="label.title"/></td>
				<td><html:text property="title" styleId="title" /></td>
				<td style="color: red"><html:errors
						property="titleMessageError" /></td>
			</tr>

			<tr>
				<td><label for="category" /><bean:message key="label.category"/></td>				
				<td>
					<html:select  property="categoryId" styleId="category">
						<html:option value="0" >Select category</html:option>
						<logic:present name="categoryArrayList" >
							<html:optionsCollection name="categoryArrayList" value="categoryId" label="categoryTitle"/>
						</logic:present>
					</html:select>
				</td>
				<td style="color: red"><html:errors
						property="categoryMessageError" /></td>
			</tr>

			<tr>
				<td><label for="image" /><bean:message key="label.image"/></td>
				<td><html:text property="image" styleId="image" /></td>
				<td style="color: red"><html:errors
						property="imageMessageError" /></td>
			</tr>
			<tr>
				<td><label for="caption" /><bean:message key="label.caption"/></td>
				<td><html:text property="caption" styleId="caption" /></td>
				<td style="color: red"><html:errors
						property="captionMessageError" /></td>
			</tr>
			<tr>
				<td><label for="summary" /><bean:message key="label.summary"/></td>
				<td><html:textarea property="summary" styleId="summary" cols="50" rows="5"/></td>
				<td style="color: red"><html:errors
						property="summaryMessageError" /></td>
			</tr>

			<tr>
				<td colspan="3" style="color: red">
				<html:errors property="contentMessageError" />
				<html:textarea property="content" styleId="editor"/></td>
			</tr>

			<tr>
				<td><label for="showed"/><bean:message key="label.showed"/></td>
				<td>
					<html:radio property="showed" styleId="showed" value="true" >Yes</html:radio>
					<html:radio property="showed" styleId="showed" value="false">No</html:radio>
				</td>
			</tr>
			
			<tr>
				<td><label for="important"/><bean:message key="label.important"/></td>
				<td>
					<html:radio property="important" styleId="important" value="true" >Yes</html:radio>
					<html:radio property="important" styleId="important" value="false">No</html:radio>
				</td>
			</tr>

		</table>

		<html:submit property="submit" value="Submit"></html:submit>
	</html:form>
	<script type="text/javascript"
		src="../../../ckeditor/ckeditor.js?t=B37D54V" charset="ISO-8859-1"></script>
			<script type="text/javascript"
		src="../../../ckeditor/config.js" charset="utf-8"></script>
	<script type="text/javascript">
		//<![CDATA[
		CKEDITOR.replace( 'editor', {
	        customConfig : '../../../ckeditor/config.js'
	    });

		//]]>
	</script>

</body>
</html>